class Livehouse < ActiveRecord::Base
  has_one :live
  attr_human_name :name => 'Live House名', :adress => '住所', :phone => '電話番号', :fax => 'FAX', :image => '画像'
  file_column :image,:magick => {:size => "75x100"}
  validates_presence_of :name
  validates_uniqueness_of :name
#  validates_format_of(:phone, :with => %r{[\d\-]}i, :message => "が正しくありません")
#  validates_format_of(:fax, :with => %r{[\d\-]}i, :message => "が正しくありません")
  validates_file_format_of(:image, :in => ["gif", "png", "jpg"], :message => "はGIF,JPG,PNG画像でなければなりません")

#  protected
#  def validate
#    errors.add(:phone, "が正しくありません") unless phone.nil? || /[\d\-]/
#  end
end
